package com.lihuinch.ti4j.chap7.demo;

/**
 * 用于测试try中包含return,finally是否执行
 *
 * @author lihuinch
 * @date 2018/1/27
 */
public class TryReturn {
    public static void main(String[] args) {
        try {
            System.out.println("try and then return");
            test();
            return ;
        } finally {
            System.out.println("finally");
        }


    }

    public static String test() {
        try {
            System.out.println(" test try and then return");
            return "test return";
        } finally {
            System.out.println("test finally");
        }
    }
}
